<%@page import="com.dfhc.bus.busmessage.IMessageConstants" %>
<%@page import="com.dfhc.util.StringHelper"%>
<%@ page contentType="text/html; charset=UTF-8" language="java"%>
<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="Bookmark" href="/favicon.ico" >
<link rel="Shortcut Icon" href="/favicon.ico" />

<!-- 全局js 和css包 -->
<%@ include file="/jsp/include/web/new/global.jsp" %>
<title>添加消息表 </title>

<%@ taglib uri="/dfhc" prefix="dfhc" %>
</head>
<body>


<article class="page-container">







	<form action="" method="post" class="form form-horizontal" id="form-busmessage-add">
	   <input type="hidden" id="id" name="id" value="${bean.id}">
							
							
	    <dfhc:div templateId="h_ui_div_row_cl">
	    <dfhc:title templateId="h_ui_label_title"><%=IMessageConstants.TABLE_COLUMN_DISPLAY.get("senderId")%>：</dfhc:title>	    
	    <dfhc:div templateId="h_ui_div_fromcontrol">	        
			<dfhc:input templateId="h_ui_input" value="${bean.senderId}" placeholder="" id="senderId" name="senderId"/>			
	    </dfhc:div>	    		 
	  </dfhc:div>
							
	    <dfhc:div templateId="h_ui_div_row_cl">
	    <dfhc:title templateId="h_ui_label_title"><%=IMessageConstants.TABLE_COLUMN_DISPLAY.get("title")%>：</dfhc:title>	    
	    <dfhc:div templateId="h_ui_div_fromcontrol">	        
			<dfhc:input templateId="h_ui_input" value="${bean.title}" placeholder="" id="title" name="title"/>			
	    </dfhc:div>	    		 
	  </dfhc:div>
							
	    <dfhc:div templateId="h_ui_div_row_cl">
	    <dfhc:title templateId="h_ui_label_title"><dfhc:span templateId="h_ui_not_null_span"></dfhc:span><%=IMessageConstants.TABLE_COLUMN_DISPLAY.get("content")%>：</dfhc:title>	    
	    <dfhc:div templateId="h_ui_div_fromcontrol">	        
			<dfhc:input templateId="h_ui_input" value="${bean.content}" placeholder="" id="content" name="content"/>			
	    </dfhc:div>	    		 
	  </dfhc:div>
							
	    <dfhc:div templateId="h_ui_div_row_cl">
	    <dfhc:title templateId="h_ui_label_title"><%=IMessageConstants.TABLE_COLUMN_DISPLAY.get("expirationTime")%>：</dfhc:title>	    
            <dfhc:div templateId="h_ui_div_fromcontrol">	        
			<dfhc:input templateId="h_ui_timestamp_input" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" value="${bean.expirationTime}" id="expirationTime" name="expirationTime" readonly="true"/>
	    </dfhc:div>	    		 
	  </dfhc:div>
							
	    <dfhc:div templateId="h_ui_div_row_cl">
	    <dfhc:title templateId="h_ui_label_title"><%=IMessageConstants.TABLE_COLUMN_DISPLAY.get("messageType")%>：</dfhc:title>	    
			<dfhc:div templateId="h_ui_div_fromcontrol">
				<dfhc:select templateId="h_ui_select" size="1" name="messageType" id="messageType" pleaseSelect="1" defaultValue="${bean.messageType}" sqlOption="code" code="MESSAGE_TYPE" />				
			</dfhc:div>
	  </dfhc:div>
							
	    <dfhc:div templateId="h_ui_div_row_cl">
	    <dfhc:title templateId="h_ui_label_title"><%=IMessageConstants.TABLE_COLUMN_DISPLAY.get("messageDisplayType")%>：</dfhc:title>	    
			<dfhc:div templateId="h_ui_div_fromcontrol">
				<dfhc:select templateId="h_ui_select" size="1" name="messageDisplayType" id="messageDisplayType" pleaseSelect="1" defaultValue="${bean.messageDisplayType}" sqlOption="code" code="MESSAGE_TYPE" />				
			</dfhc:div>
	  </dfhc:div>
		<dfhc:div templateId="h_ui_div_row_cl">
			<dfhc:div templateId="h_ui_div_pop_up_button">
				<dfhc:button templateId="h_ui_submit_button" />
			</dfhc:div>
		</dfhc:div>
	</form>
</article>



<script type="text/javascript">
$(function(){
	//获取新id
	<c:if test="${empty bean}"> 
	$('#id').val(getNewId('<%=IMessageConstants.TABLE_NAME%>'));
	</c:if>


	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
	
	$("#form-busmessage-add").validate({
		rules:{
			title:{			
				maxlength:400
			},
			content:{			
				required:true,
				minlength:1,
			},
			expirationTime:{			
			},
			messageType:{			
				maxlength:2
			},
			messageDisplayType:{			
				maxlength:2
			}
		},
 		messages: {
			title:{
		        maxlength: "标题最大长度为400个字母"
	           },
			content:{
		        required: "请输入内容",
		        minlength: "内容至少由1个字母组成",
	           },
			expirationTime:{
	           },
			messageType:{
		        maxlength: "消息类型最大长度为2个字母"
	           },
			messageDisplayType:{
		        maxlength: "消息显示类型最大长度为2个字母"
	           }
	    },		
		onkeyup:false,
		focusCleanup:true,
		success:"valid",
		submitHandler:function(form){
			<c:if test="${empty bean}"> 
			var url = getRootPath()+"/busmessage/insert?jsguid="+$('#id').val();
			</c:if>
			<c:if test="${not empty bean}"> 
			var url = getRootPath()+"/busmessage/update?jsguid="+$('#id').val();
			</c:if>
			//提交成功关闭
			submitAjax(url,$("#form-busmessage-add").serialize()); 		    		    		
		}
	});
});
</script> 
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>
